<% if @tasks.present? %>
    <div class="export-options">
      <%= link_to "PDF", current_url(:format => :pdf), :target => "_blank" %>
      <%= link_to "CSV", current_url(:format => :csv), :target => "_blank" %>
      <%= link_to "Excel", current_url(:format => :xls), :target => "_blank" %>
    </div>

    <table class="table sortable-table highchart" data-graph-container-before="1" data-graph-type="line" data-graph-xaxis-rotation="-45">
  <thead>
  <tr>
    <th width="400">Task</th>
    <th data-graph-skip="1" width="300">Department</th>
    <th data-graph-skip="1" width="300">Team</th>
    <th width="200">Employees</th>
    <th data-graph-skip="1" width="100">Hours</th>
    <th class="hidden_class" data-graph-skip="1" width="100">Hours</th>
    <th class="hidden_class"  width="100">Hours</th>
    <th data-graph-skip="1" width="100">Status</th>
  </tr>
  </thead>
  <% @tasks.each do |task| %>
      <tr>
        <td><%= link_to task.name, reports_task_path(:id=>task.id) %></td>
        <td><%= task.project.name %></td>
        <td><%= task.team.name %></td>
        <td><%= @assignees[task.id].to_i %></td>
        <td class="hidden_class"><%= @work_logs[task.id].nil? ? '0' : @work_logs[task.id].gsub(':','')  %></td>
        <td><%= @work_logs[task.id].nil? ? '0:00' : @work_logs[task.id] %></td>
        <td class="hidden_class"><%= @work_logs[task.id].nil? ? '0,00' : @work_logs[task.id].gsub(':',',')  %></td>
        <td><%= task.status == 'active' ? 'Pending' : task.status.capitalize  %></td>
      </tr>
  <% end %>
</table>
<script type="text/javascript">
    $(".sortable-table").tablesorter();
    if ($('.table tbody tr').length > 1){$('table.highchart').highchartTable();}
</script>
<% else %>
    <div class="alert-box secondary">
      No sufficient data yet.
    </div>
<% end %>